package cn.seecoder.ai.utils;

/**
 * @author fanyanpeng
 * @date 2023/4/24 22:48
 */
public class DataTypeHelper {

    public static Double toDouble(Object obj){
        return Double.valueOf(obj.toString());
    }
    public static Long toLong(Object obj){
        String stringValue = obj.toString();
        if(stringValue.endsWith("L")){  //对于默认值，去掉末尾
            stringValue=stringValue.substring(0,stringValue.length()-1);
        }
        return Long.valueOf(stringValue);
    }
    public static Integer toInteger(Object obj){
        return Integer.valueOf(obj.toString());
    }
}
